home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 July
/
Macworld (1999-07).dmg
/
Shareware World
/
Info
/
For Developers
/
Mops 3.4.sea
/
Mops source
/
Toolbox classes
/
Window
< prev
next >
Wrap
Text File
|
1998-09-21
|
3KB
|
132 lines
\ Window class.
\ May 91 mrh Added NonScrollWind.
\ Default grow and drag limits set at grow and drag time.
\ Also fixed a number of long-standing bugs in draw:, enable:, disable:
\ etc. New: deactivates current window. Added PenIntoWind:.
\ July 91 mrh Moved Window class into module WindowMod.
\ Sept 97 mrh Updated for PowerMops
variable THEWINDOW
-1 constant INFRONT
variable THEPORT
129 constant THUMB
0 constant DOCWIND
16 constant RNDWIND
1 constant DLGWIND
0 value SaveActW \ Saves actW over Suspend-Resume
forward WHRFEV \ Will become where: fEvent
syscall TextFont
syscall TextFace
syscall TextMode
syscall TextSize
syscall DrawGrowIcon
syscall CloseWindow
syscall BeginUpdate
syscall EndUpdate
syscall SelectWindow
syscall FrontWindow
syscall DragWindow
syscall SizeWindow
syscall MoveWindow
syscall TrackBox
syscall ZoomWindow
syscall GrowWindow
syscall SetWTitle
syscall GetWTitle
syscall ShowWindow
syscall HideWindow
syscall NewWindow
sysCall NewCWindow
syscall GetNewWindow
syscall GetNewCWindow
\ NoClip is a very useful word...
: NOCLIP 0 0 32766 dup put: tempRect addr: tempRect ClipRect ;
\ ( val -- ) These next words set text characteristics for current grafPort
: TFONT TextFont ;
: TFACE TextFace ;
: TMODE TextMode ;
: TSIZE TextSize ;
: INITFONT 9 tsize 4 tfont ( Monaco ) 0 tMode 0 tFace ;
PPC?
[IF]
: TBOOL \ ( b -- bool ) Makes a Mops boolean into a Toolbox boolean
inline{ 1 and } ;
[ELSE]
: TBOOL \ ( b -- bool ) Makes a Mops boolean into a Toolbox boolean
$ 100 and makeint ;
[THEN]
\ Save and restore the GrafPort
: SAVEPORT thePort GetPort ;
: RESTPORT thePort @ SetPort ;
\ Utility routines for calculating a scroll bar's position.
: >VRECT { left top rt bot -- l' t' r' b' }
rt 15 - top 1- rt 1+ bot 14 - ;
: >HRECT { left top rt bot -- l' t' r' b' }
left 1- bot 15 - rt 14 - bot 1+ ;
from WindowMod import{ WINDOW }
compile: windowMod
true setinstall: windowMod
\ NonScrollWind is a window that will not scroll. This preserves fprect which we
\ may be using for scrolling text somewhere else.
:class NONSCROLLWIND super{ window }
:m CLASSINIT:
classinit: super false setScroll: self ;m
;class
fWind ' window set_class
classinit: fWind markalive: fWind
true value fWindActive? \ Will be true only when fwind is active.
\ It is set/reset by enFW and disFW (see
\ FEMod.txt).
: resize_fWind { \ l t r b -- }
\ resizes fWind according to the current screen.
fWind? 0EXIT
getRect: fWind -> b -> r -> t -> l
screenbits ( -- l t r b )
2/ b max -> b
2/ r max -> r 2drop
r b size: fWind
noClip
;
resize_fWind